const getters = {
    token:state=>state.user.token,
    user:(state)=>{
        let user=state.user.user;
        if(user){
            return typeof user ==='object'?user:JSON.parse(user);
        }else{
            return null;
        }
    },
    identity:state=>state.user.identity
}
export default getters
